﻿using System.Collections.Generic;
using Ornament.ImportHelper;

namespace Fee.IO.Importers
{
    public class PreDelegateOrderWorkActivity
    {
        public string StationName { get; set; }
        public string StationCode { get; set; }
        public bool Forward { get; set; }
        public string Comment { get; set; }
    }

    public class PredelegateOrder<T> : BaseImporter<T> where T : FeeDbContext
    {
        public PredelegateOrder(T context, bool saveInDb) : base(context, saveInDb)
        {
        }

        protected override bool ConverTo(IList<string> rowStringInfo, out ImportResultItem item)
        {
            item = new ImportResultItem();

            var r = new PreDelegateOrderWorkActivity();
            r.StationName = rowStringInfo[0];
            r.StationCode = rowStringInfo[1];
            r.Forward = rowStringInfo[2] == "是";

            r.Comment = rowStringInfo.ImportString(3, "处理建议", item);


            item.Data.Add(r);
            return true;
        }
    }
}